package LInkedList;

import org.w3c.dom.ls.LSOutput;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:岁亮亮
 * Date:2024-05-20
 * TIME:15:55
 */
public class Test {
    /***
     * LinkedList与 ArrayDeque 都可以既是单向队列或者 双端队列
     * 一个是链表实现 一个数组实现
     * @param args
     */
    public static void main(String[] args) {
        /*Queue<String> queue = new PriorityQueue<>();
        Queue<String> queue1 = new LinkedList<>();
        Deque<String> dueue2 = new ArrayDeque<>();
        Deque<String> deque = new LinkedList<>();
        LinkedList<String > sstr = new LinkedList<>();
        System.out.println(sstr.toString());*/
        Stack<Integer> stack = new Stack<>();
        stack.add(1);
        stack.add(1);
        stack.add(1);
        stack.add(1);
        stack.add(3);
        Integer s = stack.peek();
        System.out.println(s);
    }

    public static void main4(String[] args) {
        MyLinkedList str = new MyLinkedList();
        str.addLast(11);
        /*str.addLast(112);
        str.addLast(113);
        str.addFirst(999);
        str.addFirst(998);
        str.addFirst(997);
        str.addIndex(0, 555);
        str.addIndex(4, 444);
        str.addIndex(8, 888);*/
        str.remove(11);
        str.display();
        System.out.println("==========");
      /* str.reverseLinkedList();
       str.display();*/

    }

    public static void main3(String[] args) {
        MySingleList str = new MySingleList();
        str.clear();
        LinkedList<String> list = new LinkedList<>();

    }

    public static void main2(String[] args) {
        MySingleList str = new MySingleList();
        str.addFirst(12);
        str.addFirst(123);
        str.addFirst(124);
        str.addFirst(125);
        str.addLast(987);
        str.addLast(986);
        str.addLast(985);
        str.addFirst(125);
        str.addFirst(124);
        str.display();
        System.out.println("========");
       str.reverseSingleList2();
       LinkedList<Integer> str3 = new LinkedList<>();
        System.out.println(str);
       str.display();


        /*System.out.println("========");
        str.removeAllKey(124);
        str.display();*/
       /* str.display();
        System.out.println(str.size());
        System.out.println("==========");
        str.addIndex(7,999);
        str.addIndex(0,111);
        str.addIndex(1,222);
        str.display();*/

    }

    public static void main1(String[] args) {
       /* MySingleList mySingle = new MySingleList();
        mySingle.createSingleList();
        *//*mySingle.display();
        System.out.println(mySingle.size());
        System.out.println("=============");
        mySingle.clear();
        System.out.println(mySingle.size());*//*
        mySingle.addFirst(234);
        mySingle.addLast(345);
        mySingle.addIndex(2,456);
        System.out.println("=========");
        mySingle.display();
        System.out.println("=========");
        mySingle.addFirst(23);
        mySingle.display();

        System.out.println("=========");

        mySingle.removeAllKey(23);
        mySingle.display();*/
        /*System.out.println("=========");
        mySingle.removeAllKey(23);*/
        /*mySingle.display();*/
       /* mySingle.display();
        System.out.println(mySingle.size());*/
    }
}
